package com.wyz.serviceImpl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.wyz.entity.Student;
import com.wyz.entity.Titletable;
import com.wyz.mapper.TitletableMapper;
import com.wyz.service.TitletableService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Service
public class TitletbaleServiceImpl implements TitletableService {
    @SuppressWarnings("SpringJavaInjectionPointsAutowiringInspection")
    @Autowired
    TitletableMapper titletableMapper;

    @Override
    public int add(Titletable titletable) {
        return titletableMapper.add(titletable);
    }

    @Override
    public int del(int id) {
        return 0;
    }

    @Override
    public PageInfo<Titletable> findAll(String grade, String name,int indexPage,int pageSize) {
        Map map = new HashMap();
        map.put("name",name);
        map.put("grade",grade);
        PageHelper.startPage(indexPage,pageSize);
        return new PageInfo<Titletable>(titletableMapper.findAll(map));
    }

    @Override
    public List<Titletable> findByGradeId(int id) {
        return null;
    }
}
